Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.showLoginTipModal = showLoginTipModal, exports.default = _default;

var _apiCode = _interopRequireDefault(require("./api-code.js")), _promise = _interopRequireDefault(require("./promise.js"));

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

function showLoginTipModal() {
    wx.showModal({
        title: "请先登录",
        content: "接下来的操作需要您登录后才能继续",
        confirmText: "去登录",
        success: function(e) {
            if (e.confirm) {
                var o = getApp().globalData, i = o.app, t = o.appid;
                wx.navigateTo({
                    url: "/public/pages/verify/verify?app=".concat(i, "&appid=").concat(t)
                });
            }
        }
    });
}

function _default(e) {
    return e.code === _apiCode.default.TOKEN_INVALID ? (showLoginTipModal(), new _promise.default(function() {})) : _promise.default.resolve(e);
}